package com.example.demo.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import com.example.demo.pojo.User;
import com.example.demo.mapper.UserMapper;
import com.example.demo.service.UserService;
import org.springframework.stereotype.Service;

/**
 * @author cyt
 * @create 2021-03-21 0:18
 */
@Service
public class UserServiceImpl extends ServiceImpl<UserMapper, User> implements UserService {
    @Autowired
    private UserMapper userMapper;

 //   @Transactional(rollbackFor = Exception.class)
//    @ShardingTransactionType(TransactionType.XA)
    @Override
    public String testTx() {
        User user = new User();
        user.setUid(222);
        user.setName("tx");
        userMapper.insert(user);
        return user.toString();
    }
}
